<div class="header">
   <div class="wrap">
      <div class="logo">
         <a href="/"><h1 style="padding-top: 6px;" title="ID SUDO"><img src="/themes/img/logo.png" alt="Logo id sudo" /></h1></a>
      </div>
      <div class="user">
         <a href="javascript:;" onclick="ToggleLogin()" class="door_down_inner_home open_door">
            <img class="arrow_down" src="/themes/img/icon_arr_bt.png"/>
         </a>
         <?if($myuser->logged() == 1) {?>
            <p title="<?=$myuser->email?>"><?=cut_string($myuser->email,16)?></p>
            <div class="avatar">
               <img src="<?=$myuser->avatar?>" alt="" />
            </div>
       <? }else{ ?>           
            <p onclick="ToggleLogin()">Đăng nhập</p>
            <p>| </p><a href="/dang-ky.html" class="register-re">Đăng ký</a>
            
         <? } ?>
         <div id="loginFrame">
               <div class="loginFrameContent">
                  <div class="login_head">
                     <a href="/trang-ca-nhan/">Trang cá nhân</a><br />
                     <a href="/thoat.html">Thoát</a>      
                  </div>
               </div>
               
            </div>
         </div>
         <script type="text/javascript">
            function ToggleLogin() {
               if (document.getElementById("loginFrame").style.display == "block"){
                  jQuery("#loginFrame").slideUp();
                  $(".arrow_down").removeClass("rotate_arrow");
               }
               else {
               jQuery("#loginFrame").slideDown();
               $(".arrow_down").addClass("rotate_arrow");
               }
            }
            $('#txtusername,#txtpassword').keyup(function(e){
               if(e.keyCode == '13'){
                  checklogin();
               }
            })
      </script>
   </div><!-- End .wrap -->
</div><!-- End .header -->